package com.ygt.util;

/**
 * @Author ygt
 * @Date 2022/11/8 18:10
 * @Version 1.0
 * 返回数据应该添加的东西，目的是让浏览器识别
 */


public class ResponseUtil {

    public static final String responseHeader200 = "HTTP/1.1 200 \r\n" +
            "Content-Type:text/html \r\n"+"\r\n";

    public static String getResponseHeader404(){
        return "HTTP/1.1 404 \r\n"+
                "Content-Type:text/html \r\n"+"\r\n"+"404";
    }

    public static String getResponseHeader200(String context){
        return "HTTP/1.1 200 \r\n"+
                "Content-Type:text/html \r\n"+"\r\n" + context;
    }
}
